Xbasic

UI_GET_PATH Function

Syntax

path as C = ui_get_path(C title ,C drive_list ,C default )

Arguments

path

The selected directory. The directory must exist. If the Starting_Folder does not exist, the first subfolder that does exist will be returned.

title

The title of the dialog box.

drive_list

The drive portion of the path to display. You can specify multiple drives separated by semicolons ("C:\;D:\"). Do not add spaces between drives.

default

The directory portion of the path to display. Note : The default directory must have a trailing backslash.

Description

Prompt user for a file path. If drive_list is blank, shows all drives. Drive_list is a semi-colon delimited list of drives. TIP: You can also use ui_browse_for_folder() to use the standard Windows control.

UI_GET_PATH() displays a dialog box that allows the user to select a folder (i.e. sub-directory). The dialog displays all of the folders on Drive, starting in the Starting_Folder.

images/ui_get_path.gif

Note : The Starting_Folder directory must exist. If you use the final "\" character after a path, either escape it with a second "\" character or add a final space " " character. This function cannot be used to select the root folder of a drive. To do that, use the ui_browse_for_folder Function. In addition, the ui_get_path function is written in Xbasic and is not a 'standard' way of prompting for a folder. The ui_browse_for_folder Function wraps the standard windows control for prompting for a folder name, and so this control might be more familiar to users. The ui_get_path() function allows the user to create new folders, whereas ui_browse_for_folder() does not. If you do not need the option to create new folders, prefer the ui_browse_for_folder Function.

Example

Display the dialog shown in the above diagram.

path = UI_GET_PATH ("Enter Path","c\: ", "c:\windows\\")
ui_get_path("Folder Name", "C:\;D:\ ", "C:\documents\ ")

Limitations

Desktop applications only.

See Also